<template>
  <span
    :style="`{
    background-image: url('${svgContent}');
  }`"
    :class="`i-vscode-icons:${svgContent}`"
  />
</template>

<script setup lang="ts">
import { iconClass } from '@/utils/FileTool.js'

import { computed } from 'vue'

const props = defineProps({
  className: {
    type: String,
    default: '',
  },
  folder: {
    type: Boolean,
    default: false,
  },
  openFolder: {
    type: Boolean,
    default: false,
  },
})

const svgContent = computed(() => {
  const re = iconClass(props.className, props.folder, props.openFolder)
  console.log(re)
  return `/src/assets/icons${re}`
})
</script>

<style scoped>
svg {
  /* 在这里添加你的 CSS 样式 */
  width: 1em;
  height: 1em;
  fill: currentColor;
}
</style>
